const mysql = require('mysql2');
const config = require("../config")
//  引用 连接数据库的对象

//  每次连接数据库  会主动断开
//  每次查询会再连接一次 
let connect = mysql.createPool({
    host: config.host,
    user: config.user,
    database: config.database,
    password: config.password,
    multipleStatements: true
})
const promisePool = connect.promise();

module.exports = promisePool